package ec.edu.uce.tour.servicio.menu;

import java.util.ArrayList;
import java.util.List;

import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

import ec.edu.uce.tour.dto.Item;
import ec.edu.uce.tour.dto.Menu;
import ec.edu.uce.tour.dto.Submenu;

@Stateless
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public class ServicioMenu {

	public void crearMenu()
	{
		//Menu menu = new Menu();
		List<Item> items = new ArrayList<Item>();
		Item it = new Item(2, 1, "MENU", "2", null, "");
		Item it2 = new Item(3, 2, "subMENU", "2-3", null, "");
		Item it3 = new Item(1, 3, "item1", "2-3-1", "/prueba.html", "");
		Item it4 = new Item(4, 3, "item2", "2-4", "prueba2.html", "");
		items.add(it);
		items.add(it2);
		items.add(it3);
		items.add(it4);
//		List<Menu> listaMenus = new ArrayList<Menu>();
		
		for (Item item : items) {
			if(item.getTipo() == 1){
			Menu menu = new Menu();
			menu.setIdMenu(item.getId());
			
			}
			if(item.getTipo()==2){
				Submenu submenu = new Submenu();
				submenu.setIdSubmenu(item.getId());
			}
			if(item.getTipo()==3){
				Item itm = new Item();
				itm.setId(item.getId());
			}
		}
	
	}
	
}
